use criterion::{black_box, criterion_group, criterion_main, Criterion};
use lession_daily::*;



fn criterion_benchmark(c: &mut Criterion) {
    c.bench_function("fib 20", |b| b.iter(|| fibonacci(black_box(20))));
}

fn fib_200_benchmark(c: &mut Criterion) {
    c.bench_function("fib 200", |b| b.iter(|| big_fibonacci_bench(black_box(200))));
}

fn rand_str_10_benchmark(c: &mut Criterion) {
    c.bench_function("rand_str 10", |b|b.iter(||rand_str(black_box(10), black_box("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))));
}
fn rand_str_64_benchmark(c: &mut Criterion) {
    c.bench_function("rand_str 64", |b|b.iter(||rand_str(black_box(10), black_box("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))));
}

fn sort_benchmark(c: &mut Criterion) {
    c.bench_function("sort 20", |b| b.iter(|| {
        let mut arr = vec![4, 2, 5, 7, 8, 1];
        sort(&mut arr, 6);
    }));
}

criterion_group!(benches, criterion_benchmark, fib_200_benchmark, sort_benchmark, rand_str_10_benchmark, rand_str_64_benchmark);
criterion_main!(benches);